const mongoose = require('mongoose')

const Schema = mongoose.Schema

const NewsSchema = new Schema(
  {
    title: {
      type: String,
      require: true,
    },
    img: {
      type: String,
      require: true,
    },
    desc: {
      type: String,
      require: true,
    },
    content: {
      type: String,
      require: true,
    },
  },
  {
    timestamps: { currentTime: () => Date.now() },
  }
)

const NewsModel = mongoose.model('news', NewsSchema)

module.exports = NewsModel
